import { createApp } from 'vue';
import App from './App.vue';
import router from './router';

import { message, Modal, notification } from 'ant-design-vue';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import * as Icons from "@ant-design/icons-vue";

import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

import tool from './utils/tool.js';
import http from './utils/http.js';
import Table from '@/components/Table/Table.vue';
import Nav from '@/components/Table/Nav.vue';

var app = createApp(App);
app.use(router);
app.use(Antd);

app.config.globalProperties.$Message = message;
app.config.globalProperties.$Modal = Modal;
app.config.globalProperties.$Notification = notification;

app.config.globalProperties.$tool = tool;
app.config.globalProperties.$http = http;
app.config.globalProperties.$dayjs = dayjs; 


// 全局使用图标
const icons = Icons;
for (const i in icons) {
    app.component(i, icons[i]);
}
// 添加到全局
app.config.globalProperties.$Icons = Icons

dayjs.locale('zh-cn');
app.component("Table", Table);//自定义table组件
app.component("Nav", Nav);//自定义Nav组件

app.mount('#app');